Package-level declarations

Types

Link copied to clipboard

Represents the outcome of advancing a LinearAnimationInstance.

Link copied to clipboard
Link copied to clipboard
class AnimationState(unsafeCppPointer: Long) : LayerState

AnimationStates are a base class for state machine layer states.

Link copied to clipboard
class AnyState(unsafeCppPointer: Long) : LayerState

AnyStates are a base class for state machine layer states.

Link copied to clipboard
class Artboard(unsafeCppPointer: Long, fileLock: ReentrantLock, file: File? = null) : NativeObject

Artboards as designed in the Rive animation editor.

Link copied to clipboard
class AudioAsset(address: Long, rendererTypeIdx: Int) : FileAsset

A thin Kotlin wrapper for the underlying C++ audio asset. Helpful to distinguish between various FileAsset subclasses.

Link copied to clipboard
class BindableArtboard(unsafeCppPointer: Long, val viewModelInstance: ViewModelInstance? = null) : NativeObject

A BindableArtboard is an artboard reference that can be assigned to a ViewModelArtboardProperty. It should only be used for that purpose and cannot be used as a regular Artboard.

Link copied to clipboard
class BlendState(unsafeCppPointer: Long) : LayerState

BlendStates are a base class for state machine layer states.

Link copied to clipboard
class BytesRequest(url: String, onResponse: (bytes: ByteArray) -> Unit, errorListener: Response.ErrorListener) : Request<ByteArray>
Link copied to clipboard
open class CDNAssetLoader(context: Context) : FileAssetLoader

Loads assets from Rive's CDN when marked as "Hosted" in the Rive editor. Uses the FileAsset.cdnUrl field as the URL.

Link copied to clipboard
abstract class ContextAssetLoader(context: Context) : FileAssetLoader

A FileAssetLoader with access to a Context. Use this if you need context when the asset loader is constructed via reflection in XML.

Link copied to clipboard
Link copied to clipboard
class EntryState(unsafeCppPointer: Long) : LayerState

EntryStates are a base class for state machine layer states.

Link copied to clipboard

The type of Rive event.

Link copied to clipboard
class ExitState(unsafeCppPointer: Long) : LayerState

ExitStates are a base class for state machine layer states.

Link copied to clipboard
class FallbackAssetLoader(context: Context, loadCDNAssets: Boolean = true, loader: FileAssetLoader? = null) : FileAssetLoader

The default asset loader used by RiveAnimationView when loading assets. This allows for setting up cascading asset loaders which may be useful when each represents a different source or policy, e.g. a memory cache, local storage, and network.

Link copied to clipboard
class File(bytes: ByteArray, val rendererType: RendererType = Rive.defaultRendererType, fileAssetLoader: FileAssetLoader? = null) : NativeObject

Files are created in the Rive editor.

Link copied to clipboard
sealed class FileAsset : NativeObject
Link copied to clipboard
abstract class FileAssetLoader : NativeObject

Base class for asset loading. Overload loadContents to customize the loading process.

Link copied to clipboard
enum Fit : Enum<Fit>
Link copied to clipboard
class FontAsset(address: Long, rendererTypeIdx: Int) : FileAsset

A thin Kotlin wrapper for the underlying C++ font asset. Helpful to distinguish between various FileAsset subclasses.

Link copied to clipboard
object Helpers
Link copied to clipboard
class ImageAsset(address: Long, rendererTypeIdx: Int) : FileAsset

A thin Kotlin wrapper for the underlying C++ image asset. Helpful to distinguish between various FileAsset subclasses.

Link copied to clipboard
Link copied to clipboard
open class LayerState(unsafeCppPointer: Long) : NativeObject

LayerStates are a base class for state machine layer states.

Link copied to clipboard
class LinearAnimationInstance(unsafeCppPointer: Long, lock: ReentrantLock, var mix: Float = 1.0f) : PlayableInstance, NativeObject

The LinearAnimationInstance is a helper to wrap common operations to play an animation.

Link copied to clipboard
enum Loop : Enum<Loop>
Link copied to clipboard
abstract class NativeObject(initialPointer: Long) : RefCount

NativeObject is a Kotlin object that's backed by a C++ counterpart via the JNI. It keeps track of the current pointer value in its local variable unsafeCppPointer.

Link copied to clipboard
Link copied to clipboard
interface RefCount
Link copied to clipboard
Link copied to clipboard
object Rive
Link copied to clipboard

A wrapper around a native C++ object representing an audio clip that can be played in Rive.

Link copied to clipboard
open class RiveEvent(unsafeCppPointer: Long, val delay: Float) : NativeObject

A class for Rive events.

Link copied to clipboard
class RiveEventReport(val unsafeCppPointer: Long, secondsDelay: Float) : NativeObject

A class for reported Rive events to match its C++ counterpart.

Link copied to clipboard

A wrapper around a native C++ object representing a font that can be rendered in Rive.

Link copied to clipboard
class RiveGeneralEvent(unsafeCppPointer: Long, delay: Float) : RiveEvent

A general Rive event.

Link copied to clipboard
class RiveOpenURLEvent(unsafeCppPointer: Long, delay: Float) : RiveEvent

An open URL Rive event.

Link copied to clipboard

A wrapper around a native C++ object representing a raster image that can be rendered in Rive.

Link copied to clipboard
open class RiveTextValueRun(unsafeCppPointer: Long) : NativeObject

A class for text run instances.

Link copied to clipboard
class SMIBoolean(unsafeCppPointer: Long) : SMIInput

A boolean state machine input.

Link copied to clipboard
open class SMIInput(unsafeCppPointer: Long) : NativeObject

SMIInputs are a base class for state machine input instances.

Link copied to clipboard
class SMINumber(unsafeCppPointer: Long) : SMIInput

A floating point number state machine input.

Link copied to clipboard
class SMITrigger(unsafeCppPointer: Long) : SMIInput

A trigger state machines input.

Link copied to clipboard

The StateMachineInstance is a helper to wrap common operations to play a state machine.

Link copied to clipboard

A description of a ViewModel in the Rive file. It can be used to retrieve property definitions at runtime. However, properties cannot be modified - that requires an instance. Use one of the createInstance methods to create an instance with mutable properties from this ViewModel.

Link copied to clipboard
class ViewModelArtboardProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Unit>

An artboard property of a ViewModelInstance.

Link copied to clipboard
class ViewModelBooleanProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Boolean>
Link copied to clipboard
class ViewModelColorProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Int>

A color property of a ViewModelInstance. Values are represented as integers in 0xAARRGGBB format.

Link copied to clipboard
class ViewModelEnumProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<String>

An enum property of a ViewModelInstance. Values are represented as strings.

Link copied to clipboard
class ViewModelImageProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Unit>

An image property of a ViewModelInstance. Values are RiveRenderImage type, and must be constructed from encoded bytes with RiveRenderImage.make.

Link copied to clipboard

Represents an instantiated set of properties on a ViewModel. With this class you have access to the individual properties to get and set values from bindings.

Link copied to clipboard
class ViewModelListProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Unit>

A list property of ViewModelInstances.

Link copied to clipboard
class ViewModelNumberProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<Float>

A number property of a ViewModelInstance. Use value to mutate the property.

Link copied to clipboard
abstract class ViewModelProperty<T>(unsafeCppPointer: Long, fileLock: ReentrantLock) : NativeObject

A property of type T of a ViewModelInstance. Use value to mutate the property. use valueFlow to subscribe to changes on the value.

Link copied to clipboard
class ViewModelStringProperty(unsafeCppPointer: Long, fileLock: ReentrantLock) : ViewModelProperty<String>
Link copied to clipboard

A trigger property of a ViewModelInstance. Use trigger fire the trigger.